package com.example.myapplication;

import android.content.Context;
import android.databinding.ObservableField;
import android.widget.Toast;

public class User{
    private Context mContext;

    public User(Context context) {
        mContext = context;
    }

    public final ObservableField<String> name = new ObservableField<>();
    public final ObservableField<Integer> sex = new ObservableField<>();
    public final ObservableField<Integer> age = new ObservableField<>();
    public final ObservableField<Integer> icon = new ObservableField<>();

    public void OnClick(int i) {
        switch (i) {
            case 0:
                name.set("李四");
                sex.set(0);
                age.set(22);
                icon.set(1);
                Toast.makeText(mContext, "女", Toast.LENGTH_SHORT).show();
                break;
            case 1:
                name.set("张三");
                sex.set(1);
                age.set(14);
                icon.set(0);
                Toast.makeText(mContext, "男", Toast.LENGTH_SHORT).show();
                break;
        }
    }
}
